package de.slothsoft.wasbinich.core.util;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

final class Messages {

    private static final String BUNDLE_NAME = "de.slothsoft.wasbinich.core.util.messages"; //$NON-NLS-1$

    public static String getString(String key) {
	try {
	    return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
	} catch (MissingResourceException e) {
	    return '!' + key + '!';
	}
    }

    public static String getString(String key, Locale locale) {
	try {
	    return ResourceBundle.getBundle(BUNDLE_NAME, locale).getString(key);
	} catch (MissingResourceException e) {
	    return '!' + key + '!';
	}
    }

    private Messages() {
	// hide class
    }

}
